# -*- coding: utf-8 -*-
# @Time    : 2021/9/26 14:01
# @Author  : BrandonGT
# @FileName: main.py

from flask import Flask
from flask import request

app = Flask(__name__)


@app.route("/")
def hello_world():
    return "<p>Hello, World!</p>"


@app.route("/name", methods=['GET','POST'])
def get_name():
    if request.method == 'POST':
        return 'Current in POST mode'
    elif request.method == 'GET':
        return 'Current in GET mode'


@app.route("/dict")
def get_dict():
    new_dict = {
        "name": "BrandonGT",
        "value": "10000",
        }
    get_value = request.args.get('name', '')
    print(get_value)
    return new_dict